home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 2.7 KB | 100 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWCFMRes.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWCFMRES_H
- #define FWCFMRES_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWRESFIL_H
- #include "FWResFil.h"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__CODEFRAGMENTS__)
- #include <CodeFragments.h>
- #endif
-
- //========================================================================================
- // Global Variable
- //========================================================================================
- // FW_gInstance is initialize in PrivInitLibraryResources on the Mac and in DLLMain
- // on Windows 32
-
- extern FW_Instance FW_gInstance;
-
- //========================================================================================
- // Global functions
- //========================================================================================
-
- #ifdef FW_BUILD_WIN
- extern "C" BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved);
- #endif
-
- //========================================================================================
- // class FW_CAcquireCFMResourceAccess
- //========================================================================================
-
- class FW_CAcquireCFMResourceAccess
- {
- public:
- FW_CAcquireCFMResourceAccess(Environment* ev);
- FW_CAcquireCFMResourceAccess(Environment* ev, FW_Instance instance);
- ~FW_CAcquireCFMResourceAccess();
-
- #ifdef FW_BUILD_MAC
-
- FW_DECLARE_AUTO(FW_CAcquireCFMResourceAccess)
-
- short GetLibraryRefNum() const
- {return fInstance->fRefNum;}
-
- static OSErr PrivInitLibraryResources(CFragInitBlockPtr init);
- static void PrivCloseLibraryResources();
-
- private:
- void CommonInit(Environment* ev);
-
- private:
- FW_Instance fInstance;
- long fSavedLibraryRefNum;
- #endif
- };
-
- //========================================================================================
- // class FW_CSharedLibraryResourceFile
- //========================================================================================
-
- class FW_CSharedLibraryResourceFile : public FW_PResourceFile
- {
- public:
- FW_DECLARE_AUTO(FW_CSharedLibraryResourceFile)
-
- FW_CSharedLibraryResourceFile(Environment* ev);
- FW_CSharedLibraryResourceFile(Environment* ev, FW_Instance instance);
-
- virtual ~FW_CSharedLibraryResourceFile();
-
- private:
- void CommonInit(Environment* ev, FW_Instance instance);
-
- private:
- #ifdef FW_BUILD_MAC
- FW_CAcquireCFMResourceAccess fAcquireCFMResourceAccess;
- #endif
- FW_CSharedLibraryResourceFile(const FW_CSharedLibraryResourceFile& other);
- };
-
- #endif
-